#!/bin/sh
#desc:Generate an alert to the cloud
#type:redundant
#package:email

PAIR="$1-$2"
TEXT="$3"
URL="http://cloud.opendomo.com/alert/index.php"
TMPFILE="/tmp/msgconfirmation.tmp"

TEXT=`echo $TEXT | sed 's/ /+/g'`
AUID=`cat /etc/opendomo/uid`
FURL="$URL?UID=$AUID&TEXT=$TEXT"

rm -fr $TMPFILE 2>/dev/null
wget -q $FURL -O $TMPFILE 2>/dev/null
if grep -q ERROR $TMPFILE; then
	exit 1
else
	exit 0
fi

